package com.soso.gae.spider.remove.impl;

import java.util.Map;

import com.soso.core.util.log.Logger;
import com.soso.gae.spider.model.CrawlInfoCacheTable;
import com.soso.gae.spider.remove.DataRemoveService;
import com.soso.gae.spider.service.BaseService;
import com.soso.spider.context.SpiderContext;

@SuppressWarnings("serial")
public class CrawlInfoCacheRemoveService implements DataRemoveService {
	
	@Override
	public boolean remove(int removeSize, Map<String, String> params) {
		String GQL="select from "+CrawlInfoCacheTable.class.getName();
		BaseService baseService = (BaseService)SpiderContext.getInstance().getBaseService();
		Long count=baseService.deleteAll(GQL, 0, removeSize);
		Logger.info("CrawlInfoCacheTable,删除数量:"+count);
		boolean isContinue=true;
		if(count==null || count==0){
			isContinue=false;
		}
		return isContinue;
	}

	@Override
	public void removeEnd(Map<String, String> params) {
	}

}
